package vn.appsmobi.ui;

import vn.appsmobi.R;
import vn.appsmobi.model.CategoryInfo;
import vn.appsmobi.ulti.ImageLoadOption;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.TextView;

import com.nostra13.universalimageloader.core.ImageLoader;

public class CategoryListItem extends BaseListItem<CategoryInfo>
{
  private TextView mCategoryName;
  private ImageView mCategoryPhoto;

  public CategoryListItem(Context context, AttributeSet attr)
  {
    super(context, attr);
  }

  public void bind(CategoryInfo categoryInfo)
  {
    this.mCategoryName.setText(categoryInfo.getName());
    ImageLoader.getInstance().displayImage(categoryInfo.getPhoto(), this.mCategoryPhoto,ImageLoadOption.options);
  //  ImageLoader.getInstance().loadImage(this.mCategoryPhoto, categoryInfo.getPhoto(), 2130837549);
  }

  protected void onFinishInflate()
  {
    super.onFinishInflate();
    this.mCategoryPhoto = ((ImageView)findViewById(R.id.category_photo));
    this.mCategoryName = ((TextView)findViewById(R.id.category_name));
  }
}
